<html>
    <head>
        <meta charset="utf-8">
        <title>使用</title>
    </head>
    <body>
        <script src="jquery-3.7.1.min.js"></script>

        <h1 id = "testH1">你好</h1>
        <h1 id = "testH2">你好</h1>

    </body>

    <script>
        var div = document.getElementById("testH1");
        console.log(div)

        var div2 = $("#testH1");
        console.log(div2)

        console.log("=========")

        var divs = document.getElementsByTagName("h1")
        console.log(divs)

        var divs2 = $("h1");
        console.log(divs2)

        console.log("------------------")
        //dom => jquery
        var domDiv = document.getElementById("testH1");
        mydiv = $(domDiv);
        console.log(mydiv);
        //jquery => dom
        var jqDiv = $("#testH2");
        mydiv2 = jqDiv[0];
        console.log(mydiv2);
    </script>

</html>